package com.twu.biblioteca.library.controllers;

import com.twu.biblioteca.library.items.Book;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by S ARUNA on 23-04-2014.
 */
/*Acts like a book store storing all the books that belong to library as against
 AvailableBookManager which stores books available for checkout at any given time
  */
public class BookManager {
    private static final Set<Book> booklist = new HashSet<Book>();
    public static void populateBookStore()
    {
        booklist.add(new Book("BIB1010AX10","Your Brain At Work","David Rock"));
        booklist.add(new Book("BIB1012AX11","The Oath of Vayuputhras","Amish"));
    }
    public static Book getBookByISBN(String ISBN)
    {
        for(Book book:booklist)
        {
            if(book.getId().contentEquals(ISBN))
                return book;
        }
        return null;
    }
}
